/*
 * Copyright (C) 拾光分享网 
 * All rights reserved, Designed By www.hiai.top.
 * Email：goodsking@163.com.
 */
package top.hiai.search;

import top.hiai.common.model.Article;

import java.util.List;

/**
* @Author www.hiai.top
* @Email  goodsking@163.com
* @Message 更多资源尽在www.hiai.top
* @Introduction 类的介绍
*/

public class SearchService {
	
	public static final SearchService me = new SearchService();
	
    private Article articleDao = new Article().dao();
    
	public List<Article> articleSearch(String q){
		//return articleDao.find("select * from bbs_article where status=1 and content like '%"+q+"%'");
		return articleDao.find("select * from bbs_article where status=1 and concat(ifnull(`title`,''),ifnull(`content`,'')) like '%"+q+"%'");
	}
}